# -*- coding: utf8 -*-

from OpenGL.GL import *
from OpenGL.GLUT import *

from common import *


def draw_ground():
    """
    画出参考地面

    注意：会让之后的绘制颜色变化为 蓝色
    """
    # 画一个红色的坐标系原点
    glPointSize(5.0)
    glBegin(GL_POINTS)
    glColor3f(1, 0, 0)
    glVertex3i(0, 0, 0)
    glEnd()

    glPushMatrix()
    glBegin(GL_LINES)
    glColor3f(0.5, 0.7, 1.0)
    map = 10
    size = map * 2
    for x in range(-size, size+1, 4):
        glVertex3i(x, 0, -size)
        glVertex3i(x, 0, size)
    for z in range(-size, size+1, 4):
        glVertex3i(-size, 0, z)
        glVertex3i(size, 0, z)
    glEnd()

    glPopMatrix()